/*
Hermes Core: General Purpose Mobile Agent Platform
Copyright (C) 2006 UNICAM - Università degli Studi di Camerino

Group leaders: Flavio Corradini and Emanuela Merelli

Developers: Ezio Bartocci, Diego Bonura, Rosario Culmone,
Davide Lorenzoli, Leonardo Mariani, Francesca Piersigilli, 
Lorenzo Scortichini, Leonardo Vito.

GNU Lesser Public License

This library is free software; you can redistribute it 
and/or modify it under the terms of the GNU Lesser General 
Public License as published by the Free Software Foundation, 
version 2.1 of the License.

This library is distributed in the hope that it will be useful, 
but WITHOUT ANY WARRANTY; without even the implied warranty of 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public 
License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.

Emanuela Merelli
Dipartimento di Matematica ed Informatica
Università di Camerino
via Madonna delle Carceri, 62032 Camerino, Italy
E.Mail: emanuela.merelli@unicam.it
*/
package hermesV2.core.id;

import hermesV2.AgentThread;

import hermesV2.agent.Identificator;


/**
 * Iterface for the management of <CODE>Identificator</CODE>
 *
 * @author Diego Bonura
 */
public interface Identify {
    /**
     * Creates a new <CODE>Identificator</CODE> for <CODE>UserAgent</CODE>
     *
     * @param name The name of the user agent.
     *
     * @return <CODE>Identificator</CODE>
     */
    Identificator createNewUserAgentIdentificator(String name);

    /**
     * Creates a new <CODE>Identificator</CODE> for <CODE>ServiceAgent</CODE>
     *
     * @param name The name of the service agent.
     *
     * @return <CODE>Identificator</CODE>
     */
    Identificator createNewServiceAgentIdentificator(String name);

    /**
     * Adds the Agent <CODE>Identificator</CODE> to the plattform
     *
     * @param id The <CODE>Identificator</CODE> of the Agent.
     * @param at The AgentThread associated to the agent.
     */
    void addAgentIdentificator(Identificator id, AgentThread at);

    /**
     * Returns the AgentThread of the local agent, if the agent is not more in
     * the place it returns null;
     *
     * @param id The agent identificator;
     *
     * @return The AgentThread.
     */
    AgentThread getAgentThread(Identificator id);

    /**
     * Returns the Identificator object of an agent running into the current
     * place.
     *
     * @param id The string of the identificator.
     *
     * @return The Identificator object.
     */
    Identificator getAgentIdentificator(String id);

    /**
     * This method erases the agent identificator into the agentsTable
     *
     * @param id The identificator of the agent.
     *
     * @return True if the identificator is on the table False otherwise.
     */
    boolean eraseAgentIdentificator(Identificator id);

    /**
     * This method returns all the identificators of the current agents present
     * into the place.
     *
     * @return Aa array of identificators.
     */
    Identificator[] getAllAgentsIdentificators();
}
